<%@ page import="org.springside.core.Constants"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %> 
<fmt:message key="knowledge_portal_label1" var="knowledge_portal_label1"/>
<fmt:message key="knowledge_portal_label2" var="knowledge_portal_label2"/>
<fmt:message key="knowledge_portal_label3" var="knowledge_portal_label3"/>
<fmt:message key="knowledge_portal_label4" var="knowledge_portal_label4"/>
<fmt:message key="knowledge_portal_label5" var="knowledge_portal_label5"/>
<fmt:message key="knowledges_map_label1" var="knowledges_map_label1"/>
<fmt:message key="knowledge_portal_label1" var="knowledges_map_label1"/>
<fmt:message key="email2_list_label48" var="email2_list_label48"/>
<fmt:message key="knowledgeCatalogyListTree_label5" var="knowledgeCatalogyListTree_label5"/>

<link href="<c:url value="../../themes/${sessionScope.loginUser.theme}/home/css/indexStyle.css"/>"	type="text/css" rel=stylesheet>
<c:set value="${fn:length(knowledgeCatalogys)}" var="count"></c:set>
<c:if test="${count==0}">
<c:set value="4" var="count"></c:set>
</c:if>

<script type="text/JavaScript">
	var obj_box,obj_span;
	var boxLength;
	var curBoxIndex;
	var boxCount;
	boxLength=${count};
	curBoxIndex=1;	
	boxCount = ${count};
	function getObjSp(id) {
		return document.getElementById(id);
	}		
	
	function showBox(i) {
		curBoxIndex=i;
		for(var j=1;j<=boxCount;j++)
		{
			obj_box=getObjSp('fun_btn_box_'+j);
			obj_box.style.display='none';
			
			obj_span=getObjSp('span_box_'+j+'_2');
			obj_span.className='unselected';
		}
		obj_box=getObjSp('fun_btn_box_'+i);
		obj_box.style.display='';
		
		obj_span=getObjSp('span_box_'+i+'_2');
		obj_span.className='selected';	
	}
	
	function hideBox() {
	
		for(var j=1;j<=boxCount;j++)
		{
			obj_box=getObjSp('fun_btn_box_'+j);
			obj_box.style.display='none';
			
			obj_span=getObjSp('span_box_'+j+'_2');
			obj_span.className='unselected';
		}
		obj_box=getObjSp('fun_btn_box_'+curBoxIndex);
		obj_box.style.display='';
		
		obj_span=getObjSp('span_box_'+curBoxIndex+'_2');
		obj_span.className='selected';
	}
</script>
<table width="100%" class="portlet_content"  border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td valign="top">
		 <table width="100%" align="center"   border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td width="100%">				
				<div id="fun_btn" width="100%">
					<table width="100%" height="27" cellpadding="0" cellspacing="0" border="0">
						<td background="../../themes/${sessionScope.loginUser.theme}/home/images/zszx_top_left.gif" width="2"></td>
						<td background="../../themes/${sessionScope.loginUser.theme}/home/images/zszx_top_bosom.gif" align="left">
							<table width="${count*10+30}%" height="27" cellpadding="0" cellspacing="0" border="0" align="left">
							<tr>
							<!-- selected   unselected -->
							<c:forEach items="${knowledgeCatalogys}" var="indexCatalogy" varStatus="v">
								<td style="cursor:hand" class='${v.count==1?'selected':'unselected'}' id="span_box_${v.count}_2" onMouseOver="showBox(${v.count})" onMouseOut="hideBox()" title="${indexCatalogy.name}">${indexCatalogy.name}</td>
								<td width="3"></td>	
							</c:forEach>
							<c:if test="${fn:length(knowledgeCatalogys)==0}">
									<td style="cursor:hand"  class="selected" title="${email2_list_label48}${knowledgeCatalogyListTree_label5}">${email2_list_label48}${knowledgeCatalogyListTree_label5}</td>
								<td width="3"></td>	
							</c:if>
									
							</tr>
				  			</table>	
						</td>
					<td width="34"><img id="p_knowledge_img" src="../../themes/${sessionScope.loginUser.theme}/home/images/${cookie.p_knowledge.value=='none'?'zszx_top_right2.gif':'zszx_top_right.gif'}" width="34" height="27" border="0" usemap="#Map6"></td>	
					</table>														
				</div>					
						</td>
						</tr>
					</table>
	<div id="p_knowledge"  style="display: ${cookie.p_knowledge.value=='none'?'none':'inline'}">
	      <c:forEach items="${knowledgeCatalogys}" var="knowledgesCatalogy" varStatus="v">
		       <div id="fun_btn_box_${v.count}"     style="display:${v.count==1?'':'none'}">
		       <table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-left:8px">
				<tr>
					<td valign="top" style="padding-top:3px">
		       	<table width="100%"  class="tbl_left_ico" border="0" cellpadding="0" cellspacing="0">
		       	<!--  如果不设置count参数或者设置小于等于0，则默认值为5.
					 dmp: PT046412 (R110216-140) 知识中心，首页默认显示8条,记录超过5条时每增加1条，首页就减少1条占位

					 modify by yiping_sun 2011-02-24
				-->
				<c:set var="count" value="${param.count == null || param.count <= 0 ? 5 : param.count }" />	
				 <c:forEach items="${knowledgesCatalogy.knowledgeses}"  var="knowledge" begin="0" end="${ count - 1 }"> 
    							<tr> 
     								 <td> 
	           				 <a class="link_portlet"  href="#" onClick='mainJump("/modules/knowledge/knowledges.do?method=viewKnowledges&cid=${knowledge.knowledgeCatalogy.id}&id=${knowledge.id}","<%=Constants.USER_THEME_FRAME %>")' 
	           							title="${knowledge.title}"> <c:if test="${fn:length(knowledge.title)>30}"> 
							            ${fn:substring(knowledge.title,0,30)}... </c:if> <c:if test="${fn:length(knowledge.title)<=30}"> 
							            ${knowledge.title} </c:if> </td>
	      		    </tr>
	        	</c:forEach>
	        	<!-- 不足 count 条数则打印剩余空占位行 -->
			      <c:if test="${fn:length(knowledgesCatalogy.knowledgeses) < count }">
			        <c:forEach begin="${fn:length(knowledgesCatalogy.knowledgeses)}" end="${ count - 1 }">
			        	<tr><td>&nbsp;</td></tr>
			        </c:forEach>
			      </c:if>
					</table>
		<table width="100%" height="17" style="margin-bottom:3px">
        <tr>
          <td>&nbsp;</td>
          <td width="30" class="tbl_more_ico_td">
          <a href="#" class="link_portlet" onClick='mainJump("/modules/knowledge/knowledges.do?method=list&cid=${knowledgesCatalogy.id}","<%=Constants.USER_THEME_FRAME %>")'
         	title="<fmt:message key="common_more" />"><fmt:message key="common_more" /></a></td>
        </tr>
     </table>
	</td>
	</tr>
</table>
		</div>
	      </c:forEach>
			<c:if test="${fn:length(knowledgeCatalogys)==0}">
			<table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding:3 0 0 8px">
			<tr>
			<td valign="top"> 
					<table width="100%"  class="tbl_left_ico" cellpadding="0" cellspacing="0" border="0" >
					  <tr> <td >&nbsp;  </td></tr>
        			 <tr> <td >&nbsp;  </td></tr>
        		     <tr> <td >&nbsp;  </td></tr>
        		    <tr> <td >&nbsp;  </td></tr>
           	 		<tr> <td >&nbsp;  </td></tr>
           	 	</table>
				<table width="100%" height="17" style="margin-bottom:3px">
			        <tr>
			          <td>&nbsp;</td>
			          <td width="30" class="tbl_more_ico_td">
			          <a href="#" class="link_portlet" onClick='mainJump("/modules/knowledge/knowledges.do?method=knowmap&cid=0","<%=Constants.USER_THEME_FRAME %>")'
			         	title="<fmt:message key="common_more" />"><fmt:message key="common_more" /></a></td>
			        </tr>
			     </table>	
			</td>
			</tr>
		</table>				 					
			</c:if>					
			</div>	
 
	</td>
 </tr>
</table>    

 